﻿Public Class frmMain
    Private authentication As String = ""

    Private Sub rbSQL_CheckedChanged(sender As Object, e As EventArgs) Handles rbSQL.CheckedChanged
        EnableUserAndPasswordBox()
    End Sub
    Private Sub rbWindows_CheckedChanged(sender As Object, e As EventArgs) Handles rbWindows.CheckedChanged
        EnableUserAndPasswordBox()
    End Sub

    Private Sub EnableUserAndPasswordBox()
        If rbSQL.Checked = True Then
            txtUserName.Enabled = True
            txtPassword.Enabled = True
            authentication = "SQL"
            txtUserName.Focus()
        Else
            If rbWindows.Checked = True Then
                txtUserName.Enabled = False
                txtPassword.Enabled = False
                authentication = "Windows"
            End If

        End If
        If rbWindows.Checked = True Then
            txtUserName.Enabled = False
            txtPassword.Enabled = False
            authentication = "Windows"
        Else
            If rbSQL.Checked = True Then
                txtUserName.Enabled = True
                txtPassword.Enabled = True
                authentication = "SQL"
                txtUserName.Focus()
            End If
        End If

    End Sub


End Class
